<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/bower_components/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">

    <script type="text/javascript" src="/bower_components/ztree/jquery.ztree.all.min.js"></script>
    <script type="text/javascript" src="/bower_components/layer/layer.js"></script>
</head>
<body>
<div>
    <ul id="zTreeId" class="ztree"></ul>
</div>
</body>
    <script type="text/javascript">
        var setting = {
            data: {
                simpleData: {
                    enable: true,
                    idKey: "id",
                    pIdKey: "pId",
                    rootPId: 0
                }
            }
        };
        var url="http://localhost/menu/doFindZtreeMenuNodes";
        //向服务端发送ajax请求，将响应结果更新到页面上(以ztree结构进行呈现)
        $.get(url,function(result){//jsonresult
            //初始化zTree对象(参考官方-treejs.cn)-固定写法
            $.fn.zTree.init($("#zTreeId"),setting,result.data);
        })
    </script>
</html>